# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-native-package-installer
_gemname=${pkgname#ruby-}
pkgver=1.1.9
pkgrel=3
pkgdesc='Ruby bindings for cairo'
arch=('any')
url='https://cairographics.org/rcairo'
license=('LGPL-3.0-only')
depends=('ruby')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('a5944e2fcfe34cb1e4034c7692edf3cdeb63bf599d6f0c4ce93e0a2a01565b6c3183037f1e0a3606118bc71cd3dda250db3e7658e290dda1b35973411b1f10fc')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"
  _platform="$(gem env platform | cut -d':' -f2)"
  _extension_api_version="$(ruby -e'puts Gem.extension_api_version')"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm -r "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
}

